Object Text Modification Filter

Hello everybody,

I've been looking around the internet but could not manage to find an answer to this:

Is it possible to create a dynamic attribute that would be set to True if there had been a modification only to the Object Text or Heading of the object, and False otherwise.

Thanks a lot!

Martin


Mgustafsson - Thu Oct 26 10:02:16 EDT 2017

Re: Object Text Modification Filter
PekkaMakinen - Fri Oct 27 04:46:21 EDT 2017

I think you have to create your own DXL attribute for that, there is no off-the-shelf functionality of filtering objects based on attribute level changes.

 

Here is some code which I modified from DOORS DXL Attribute library Number of modifications example

 

bool getMods(Object o) 
{
    History h = null
    HistoryType ht = null
    
    // Go through the history
    for h in o do 
    {
       ht = h.type
       // Check history type, modifyObject = attribute changed, if not continue
       if (ht != modifyObject) continue
       // Check the attribute, shoulde be Object Text or Object Heading
       if ((h.attrName == "Object Text") || (h.attrName == "Object Heading")) return true
    }
    return false
}

// MAIN
if (!isDeleted(obj))
{
    bool val = getMods obj
    obj.attrDXLName =  val ""
}

Re: Object Text Modification Filter
PekkaMakinen - Fri Oct 27 04:48:15 EDT 2017

PekkaMakinen - Fri Oct 27 04:46:21 EDT 2017

I think you have to create your own DXL attribute for that, there is no off-the-shelf functionality of filtering objects based on attribute level changes.

 

Here is some code which I modified from DOORS DXL Attribute library Number of modifications example

 

bool getMods(Object o) 
{
    History h = null
    HistoryType ht = null
    
    // Go through the history
    for h in o do 
    {
       ht = h.type
       // Check history type, modifyObject = attribute changed, if not continue
       if (ht != modifyObject) continue
       // Check the attribute, shoulde be Object Text or Object Heading
       if ((h.attrName == "Object Text") || (h.attrName == "Object Heading")) return true
    }
    return false
}

// MAIN
if (!isDeleted(obj))
{
    bool val = getMods obj
    obj.attrDXLName =  val ""
}

And BTW, this check only changes happening after the last baseline as each baseline empties the current history.

If you want to check also through the previous baselines it will get somewhat more complicated. But I will leave that as an exercise :-)

Re: Object Text Modification Filter
Mgustafsson - Fri Oct 27 06:55:49 EDT 2017

PekkaMakinen - Fri Oct 27 04:46:21 EDT 2017

I think you have to create your own DXL attribute for that, there is no off-the-shelf functionality of filtering objects based on attribute level changes.

 

Here is some code which I modified from DOORS DXL Attribute library Number of modifications example

 

bool getMods(Object o) 
{
    History h = null
    HistoryType ht = null
    
    // Go through the history
    for h in o do 
    {
       ht = h.type
       // Check history type, modifyObject = attribute changed, if not continue
       if (ht != modifyObject) continue
       // Check the attribute, shoulde be Object Text or Object Heading
       if ((h.attrName == "Object Text") || (h.attrName == "Object Heading")) return true
    }
    return false
}

// MAIN
if (!isDeleted(obj))
{
    bool val = getMods obj
    obj.attrDXLName =  val ""
}

Thanks a lot! This is exactly what I needed!